package wallFactory.builders;
/**
 * Clase abstracta que modela fabricas de objectos "caja"
 * @ author Sebastian Giulietti 69032 
 * @ author Adrian Sanchez 64251
 */
import mapControl.GraphicsMapControl;

import com.jme.scene.Node;

public abstract class WallBuilder {
	//Controlador de mapa
	GraphicsMapControl mapControl;
	
	//Caja creada
	protected WallBox wall;

	/**
	 * Contructor principal	
	 * @param mapControl mapControl
	 */
	public WallBuilder(GraphicsMapControl mapControl) {
		this.mapControl = mapControl;
	}

	/**
	 * Crea el modelo 
	 */
	public abstract void buildModel();

	/**
	 * Crea textura
	 */
	public abstract void buildTexture();

	/**
	 * Crea el producto
	 */
	public void createNewWallProduct() {
		wall = new WallBox();
		wall.setNode(new Node());

	}

	/** recupera el producto
	 * @return pared
	 */
	public WallBox getWall() {
		return wall;
	}

	/** Ubica la pared
	 * @param row row
	 * @param col col 
	 */
	public void locate(int row, int col) {
		getWall().setRow(row);
		getWall().setCol(col);
		mapControl.getRootNode().attachChild(wall.getNode());
		wall.getNode().setLocalTranslation(mapControl.getTraslation(row, col));
	}

}
